#!/usr/bin/env python3
# coding:utf-8
import requests
import json
# server_url = 'http://0.0.0.0:8080/core/device_type/'
server_url = 'http://0.0.0.0:8080/core/device/'

def add_device_type():
    data = {'name': '类型5', 'code': 112124,
            'icon': '23', 'description': '温度'}
    url = server_url + 'add/'
    headers = {'Content-Type': 'application/json'}
    r = requests.post(url, json=data, headers=headers)
    print(type(r))
    print(r.json())

def del_device():
    data = {'id': 33}
    url = server_url + 'del/'
    headers = {'Content-Type': 'application/json'}
    r = requests.post(url, json=data, headers=headers)
    print(type(r))
    print(r.json())

# add_device_type()
del_device()

if __name__ == '__main__':
    pass